import router from '@/router'
import store from '@/store'
import { message } from '@/libs'
router.beforeEach((to, from, next) => {
  if (!to.meta.user) {
    next()
    return true
  }
  if (store.getters.token) {
    next()
    return true
  }
  message('warning', '请重新登录')
  next('/')
  return
})
